Optimal. Leaf size=21 \[ \frac {1}{3} \log (\cos (x)+2)-\frac {1}{3} \log (1-\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.02, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3259, 616, 31} \[ \frac {1}{3} \log (\cos (x)+2)-\frac {1}{3} \log (1-\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 616
Rule 3259
Rubi steps
\begin {align*} \int \frac {\sin (x)}{-2+\cos (x)+\cos ^2(x)} \, dx &=-\operatorname {Subst}\left (\int \frac {1}{-2+x+x^2} \, dx,x,\cos (x)\right )\\ &=-\left (\frac {1}{3} \operatorname {Subst}\left (\int \frac {1}{-1+x} \, dx,x,\cos (x)\right )\right )+\frac {1}{3} \operatorname {Subst}\left (\int \frac {1}{2+x} \, dx,x,\cos (x)\right )\\ &=-\frac {1}{3} \log (1-\cos (x))+\frac {1}{3} \log (2+\cos (x))\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 19, normalized size = 0.90 \[ \frac {1}{3} \left (\log (\cos (x)+2)-2 \log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.58, size = 17, normalized size = 0.81 \[ \frac {1}{3} \, \log \left (\cos \relax (x) + 2\right ) - \frac {1}{3} \, \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.30, size = 17, normalized size = 0.81 \[ \frac {1}{3} \, \log \left (\cos \relax (x) + 2\right ) - \frac {1}{3} \, \log \left (-\cos \relax (x) + 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.08, size = 16, normalized size = 0.76 \[ \frac {\ln \left (2+\cos \relax (x )\right )}{3}-\frac {\ln \left (-1+\cos \relax (x )\right )}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 15, normalized size = 0.71 \[ \frac {1}{3} \, \log \left (\cos \relax (x) + 2\right ) - \frac {1}{3} \, \log \left (\cos \relax (x) - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.16, size = 9, normalized size = 0.43 \[ \frac {2\,\mathrm {atanh}\left (\frac {2\,\cos \relax (x)}{3}+\frac {1}{3}\right )}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.20, size = 15, normalized size = 0.71 \[ - \frac {\log {\left (\cos {\relax (x )} - 1 \right )}}{3} + \frac {\log {\left (\cos {\relax (x )} + 2 \right )}}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________